import Vue from 'vue'
import { axios, openWindow } from "@/static/js/utils";
new Vue({
    el: '#app',
    data: {
        headInfo: []
    },
    methods: {
        logout() {
            let index = plus.webview.getLaunchWebview()
            let menu = plus.webview.currentWebview()
            index.setStyle({
                mask: "none"
            });
            menu.setStyle({
                left: "100%",
                transition: {
                    duration: 200
                }
            });
            axios.post("login/out").then(res => {
                if (res.data.code) {
                    localStorage.clear();
                    openWindow('login.html', '登录', {}, 'false')
                }
            });
        },
        reload() {
            let index = plus.webview.getLaunchWebview()
            let menu = plus.webview.currentWebview()
            mui.fire(index, 'reload')
            index.setStyle({
                mask: "none"
            });
            menu.setStyle({
                left: "100%",
                transition: {
                    duration: 200
                }
            });
        }
    },
    created() {
        axios.get("table/head_read").then(res => {
            this.headInfo = res.data.data;
        });
    }
})